clear all
set more off 

********************************************************************************
* migration DD results shown in table 5

********************************************************************************

** near near dd
use  mig_analysis_file_201458_250, clear

reghdfe log_inc treated_after /// 
	if tx_1==0 & origin_student<.2 & inrange(move_year,2011,2017)>0 & building_sample==1 & min_number>0  ///
	[aweight=building_sample_weight],absorb(msa_year building_id) vce(cl building_id)
	
reghdfe vlow_inc treated_after  /// 
	if tx_1==0 & origin_student<.2 & inrange(move_year,2011,2017)>0 & building_sample==1 & min_number>0  ///
	[aweight=building_sample_weight],absorb(msa_year building_id) vce(cl building_id)

capture drop building_tag
egen building_tag=tag(building_id)
tab treated if building_tag==1 & building_sample==1 & min_number>0
	
	

*  near-far dd

use mig_analysis_file_20145_all, clear

reghdfe log_inc treated_after /// 
	if tx_1==0 & origin_student<.2 & inrange(move_year,2011,2017)>0 &  building_sample==1 ///
	&  tx250_min_number>0 & tx256_min_number>0 ///
	[aweight=building_sample_weight] ,absorb(ring_fe building_id_year) vce(cl building_id)

reghdfe vlow_inc treated_after /// 
	if tx_1==0 & origin_student<.2 & inrange(move_year,2011,2017)>0 &  building_sample==1 ///
	&  tx250_min_number>0 & tx256_min_number>0 ///
	[aweight=building_sample_weight] ,absorb(ring_fe building_id_year) vce(cl building_id)
	

* ddd

use  mig_analysis_file_ddd, clear
  
reghdfe log_inc sample l250 sample#l250 after#l250 after_250_treated   ///
	if tx_1==0 & origin_student<.2 & inrange(move_year,2011,2017)>0 &  building_sample==1 ///
	&  tx250_min_number>0 & tx256_min_number>0 ///
	[aweight=building_sample_weight] ,absorb(ring_fe building_id_year) vce(cl building_id)

reghdfe vlow_inc sample l250 sample#l250 after#l250 after_250_treated   ///
	if tx_1==0 & origin_student<.2 & inrange(move_year,2011,2017)>0 &  building_sample==1 ///
	&  tx250_min_number>0 & tx256_min_number>0 ///
	[aweight=building_sample_weight] ,absorb(ring_fe building_id_year) vce(cl building_id)


capture drop building_tag
egen building_tag=tag(building_id)
tab sample if building_tag==1 & building_sample==1 &  tx250_min_number>0 & tx256_min_number>0
















